Add logging to extractor#1403
Open
absurdlylongusername wants to merge 3 commits intoTeamNewPipe:devfrom
Open
Conversation
Set ConsoleLogger globally for all tests
79a16cb to
5ec7581
Compare
Add string formatting to logger Add tests for logger formatting
5ec7581 to
25b04f2
Compare
5 tasks
3 tasks
TobiGr
reviewed
Nov 28, 2025
| @@ -0,0 +1,193 @@ | |||
| package org.schabi.newpipe.extractor.utils; | |||
|
|
|||
| public final class ExtractorLogger { | |||
Contributor
There was a problem hiding this comment.
A few lines of class doc would be good to have here.
TobiGr
reviewed
Dec 20, 2025
Contributor
TobiGr
left a comment
There was a problem hiding this comment.
Looks good to me, just a few nitpicks. This is good to merge once these and those above are applied.
|
|
||
| public static StreamInfo getInfo(@Nonnull final StreamExtractor extractor) | ||
| throws ExtractionException, IOException { | ||
| ExtractorLogger.d(TAG, "getInfo({extractor)", extractor); |
Contributor
There was a problem hiding this comment.
Suggested change
| ExtractorLogger.d(TAG, "getInfo({extractor)", extractor); | |
| ExtractorLogger.d(TAG, "getInfo({extractor})", extractor); |
Comment on lines
+54
to
+58
| @Test | ||
| void unmatchedBraceLeavesRemainder() { | ||
| ExtractorLogger.d("T", "Value {Unclosed", "X"); | ||
| assertEquals("Value {Unclosed", logger.lastDebug); | ||
| } |
Contributor
There was a problem hiding this comment.
Please also add tests for templates which are not correctly formatted due to an incorrect number of opening or closing braces in addition to this test:
{{test}
{no_word}}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a logging API to the Extractor.
By default it logs nothing, and users of the extractor can use setLogger to define where logs are written.
Uses ConsoleLogger for all tests by default using JUnit 5 extensions
Added some initial logs to some places.
Related PR: #1325